<template>
    <div id="player">
        <audio src="" ref="audio"></audio>
    </div>
</template>
<script>
import axios from "axios";
export default {
    methods:{
        getSong(){
            var that = this;
            var id = this.$store.state.msg;
            /*
            问题：
            码云上是https，mixed content...，把请求http改成https
            vue.config.js文件
            module.export =
            {
                
                baseUrl:"./"(加上去)
            }
            */
            axios.get("http://netease.bluej.cn/music/url?timestamp=1503",{
                params:{
                    id:id 
                }
            }).then(function(res){
                that.$refs.audio.src = res.data.data[0].url;
                that.$refs.audio.play();
            });

        }
    }
}
</script>
<style>
    
</style>